# 导包
import unittest
from api.login import LoginAPI


# 创建测试类
class TestLoginAPI(unittest.TestCase):
    # 前置处理
    def setUp(self) -> None:
        self.api_login = LoginAPI()

    # 登录成功
    def test01_login_success(self):
        response = self.api_login.login({"mobile": "13800000002", "password": "123456"})
        print(response.json())
        self.assertEqual(200, response.status_code)
        self.assertEqual(True, response.json().get("success"))
        self.assertEqual(10000, response.json().get("code"))
        self.assertIn("操作成功", response.json().get("message"))
